const express = require("express");
const path = require('path');
const app = express();
app.get("/index", (req, res) => {
    console.log(req.query);
    res.redirect('http://baidu.com');
});
app.get("/test/:id", (req, res) => {
    console.log(req.params);
    res.send('xxx');
})
app.get("/haha/second", (req, res) => {
    res.send('二级路由');
})
app.listen(3000, err => {
    if (!err) console.log("server启动！！");
    else console.log(err);
});